The present invention relates to technique concerning a memory management method, a memory management program and a memory management apparatus.
The garbage collection (GC) is technique for automatically realizing memory management for a heap area in a memory (particularly, release of unnecessary memory area being occupied) even when specified instruction is not issued from program. The GC is automatically started and accordingly there is proposed a method that influence of load by the GC is suppressed for important control such as real time processing (refer to Angelo Corsaro and Ron K. Cytron, “Efficient memory-reference checks for real-time java”, Proceedings of the 2003 ACM SIGPLAN conference on Language, compiler and tool for embedded systems, 2003 and F. Pizlo, J. M. Fox, D. Holmes and J. Vitek, “Real-time Java scoped memory: design patterns and semantics”, Proceedings of the Seventh IEEE International Symposium on Object-Oriented Real-Time Distributed Computing, 2004).
The heap area is classified into internal and external heaps.
The internal heap is a heap area to be managed by the GC and is realized as Java (Registered Trademark) heap executed in Java language, for example.
The external heap is a heap area not to be managed by the GC and the memory management therefor is realized by specified instruction from program (manually).
There are some algorithms for realizing the GC. Two algorithms thereof are now described by example.
The “mark and sweep GC” has the algorithm of marking objects from root object of program in the heap area along links successively, sweeping objects which are not marked (are floating in the air) from the heap area and compacting hashed memory spaces in the heap area into one place.
The “copying GC” has the algorithm of partitioning memory space into a plurality of sections in which only one section thereof is set as a heap area to be managed by the GC, constraining processing of marking objects along links within one section and copying objects connected to one another through links to another section in unit thereof.